var pandianid = GetQueryString('pandianid');
function ICalendarClick(){
//	onload()
}
$(document).ready(function(){
	$('#name').text(sessionStorage.getItem("name"));
	getPandianJianShopDaiban();
});

//查询门店信息
function getPandianJianShopDaiban(){
	var sendData = {};
	sendData.pandianid=pandianid;
	$.ajax({
		url: "../pandianevery_jd/getPandianJianShopDaiban"
		,type:'post'
//		,async: false
		,data:JSON.stringify(sendData)
		,contentType: "application/json; charset=utf-8"
		,dataType:'json'
		,success: function(res){
			console.log(res)
			
			$('#dataTable').empty();
			if(res.success){
				var resdata = res.data;
				for (var i = 0; i < resdata.length; i++) {
					var colorClass = "";
					if(resdata[i].flag == '0'){
						colorClass = "red";
					}
					$('#dataTable').append('<tr class="thin-border-bottom">'
							+'	<td>'+resdata[i].itemname+'</span></td>'
							+'	<td style="" class="'+colorClass+'">'+resdata[i].flagname+'</td>'
							+'</tr>');
				}
				
			}else{
				layer.alert(res.message);
			}
		}
		,error:function(XMLHttpRequest, textStatus, errorThrown) {
			 console.log(XMLHttpRequest);
			 console.log(textStatus);
			 console.log(errorThrown);
			 hideloading();
		}
	});
	
}

//开始盘点
function startPandian(id,shopcode,shopname){
	sessionStorage.setItem("shopcode",shopcode);
	sessionStorage.setItem("shopname",shopname);
	window.location.href='toJiancha_index_list?pandianid='+id;
}